package com.changgou.goods.controller;

import com.changgou.util.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zhengke
 * @date: 2020/12/13
 * @return:
 * @description:
 */
@RestController
public class TestController {

    @Autowired
    private IdWorker idWorker;

    //雪花算法测试 浏览器输入url进行刷新访问  http://localhost:9001/id
    @GetMapping("/id")
    public long createId(){
        return idWorker.nextId();
    }
}
